#ifndef _ADR_TEST_ATTRIBUTETEST_H_
#define _ADR_TEST_ATTRIBUTETEST_H_

#include <iostream>
#include <string>
#include <algorithm>

#include "adr/Metadata/Property.h"
#include "adr/Metadata/Validators/StringLengthAttribute.h"

using namespace std;
using namespace adr;

namespace adr_test {
	void AttributeTest() {
		string description = "Some average product";
		Property<string> strProp = Property<string>("description", "Product Description", &description);

		strProp.AddAttribute(new StringLengthAttribute(10));
		if (!strProp.Validate()) {
			for_each(
				begin(strProp.GetValidationErrors()),
				end(strProp.GetValidationErrors()),
				[](const string& error) {
				cout << error << endl;
			});
		}
		else {
			cout << "No errors" << endl;
		}		
	}
}

#endif